Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Matrix Functions /


MapMatrix

The MapMatrix function alters an existing matrix so that it defines a transformation from one rectangle to another, similar to the MapRect and MapRegion routines that are described in Inside Macintosh: Imaging.

pascal void MapMatrix (MatrixRecord *matrix, Rect *fromRect,
                        Rect *toRect);
matrix
Contains a pointer to a matrix structure. The MapMatrix function modifies this matrix so that it performs a transformation in the rectangle specified by the toRect parameter that is analogous to the transformation it currently performs in the rectangle specified by the fromRect parameter.
fromRect
Contains a pointer to the source rectangle.
toRect
Contains a pointer to the destination rectangle.
DESCRIPTION
The MapMatrix function affects only the scaling and translation attributes of the matrix. This function is similar to RectMatrix, with the exception that MapMatrix concatenates the translation and scaling operations to the previous contents of the matrix, whereas RectMatrix first sets the matrix to the identity state.

Figure 2-45 shows how the matrix that you obtain from the MapMatrix function transforms a source image.

Figure 2-45 Transforming an image with the MapMatrix function

SEE ALSO
You can create a matrix that maps one rectangle to another by calling the RectMatrix function, which is described in the previous section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996